// 基于template/src/widgets/\{{appEntities}}/\{{ctrls@CALENDAR}}-calendar/\{{spinalCase ctrl.codeName}}-calendar-vo.ts.hbs生成
import { ControlVOBase } from '@/core';

{{#each ctrl.psSysCalendarItems as | calendarItem |}}
    {{#if calendarItem.psAppDataEntity}}
class {{pascalCase calendarItem.itemType}}ControlVO extends ControlVOBase {

    /**
    * 实体主键属性
    *
    */
    protected readonly srfkey = '{{lowerCase calendarItem.psAppDataEntity.keyPSAppDEField.codeName}}';

    /**
    * 项标识
    *
    */
    protected readonly itemType = '{{calendarItem.itemType}}';  

    constructor(data: any){
        super(data);
        //  日历项自持属性
        this.$ownKeys = ['{{lowerCase calendarItem.psAppDataEntity.codeName}}', {{#each calendarItem.psAppDataEntity.allPSAppDEFields as | field |}}'{{lowerCase field.codeName}}'{{#unless @last}}, {{/unless}}{{/each}}];
    }
{{#if calendarItem.textPSAppDEField}}
    get title() {
        return this.$DO.{{lowerCase calendarItem.textPSAppDEField.codeName}};
    }
    set title(value: any) {
        this.$DO.{{lowerCase calendarItem.textPSAppDEField.codeName}} = value;
    }
{{/if}}
{{#if calendarItem.beginTimePSAppDEField}}
    get start() {
        return this.$DO.{{lowerCase calendarItem.beginTimePSAppDEField.codeName}};
    }
    set start(value: any) {
        this.$DO.{{lowerCase calendarItem.beginTimePSAppDEField.codeName}} = value;
    }
{{/if}}
{{#if calendarItem.endTimePSAppDEField}}
    get end() {
        return this.$DO.{{lowerCase calendarItem.endTimePSAppDEField.codeName}};
    }
    set end(value: any) {
        this.$DO.{{lowerCase calendarItem.endTimePSAppDEField.codeName}} = value;
    }
{{/if}}
{{#if calendarItem.bKColorPSAppDEField}}
    get bkcolor() {
        return this.$DO.{{lowerCase calendarItem.bKColorPSAppDEField.codeName}};
    }
    set bkcolor(value: any) {
        this.$DO.{{lowerCase calendarItem.bKColorPSAppDEField.codeName}} = value;
    }
{{/if}}
{{#if calendarItem.colorPSAppDEField}}
    get color() {
        return this.$DO.{{lowerCase calendarItem.colorPSAppDEField.codeName}};
    }
    set color(value: any) {
        this.$DO.{{lowerCase calendarItem.colorPSAppDEField.codeName}} = value;
    }
{{/if}}
{{#if calendarItem.contentPSAppDEField}}
    get content() {
        return this.$DO.{{lowerCase calendarItem.contentPSAppDEField.codeName}};
    }
    set content(value: any) {
        this.$DO.{{lowerCase calendarItem.contentPSAppDEField.codeName}} = value;
    }
{{/if}}

    set {{lowerCase calendarItem.psAppDataEntity.codeName}}(value: any) {
        this.$DO.{{lowerCase calendarItem.psAppDataEntity.keyPSAppDEField.codeName}} = value;
    }
    get {{lowerCase calendarItem.psAppDataEntity.codeName}}() {
        return this.$DO.{{lowerCase calendarItem.psAppDataEntity.keyPSAppDEField.codeName}};
    }
}
    {{/if}}
{{/each}}

export const {{pascalCase ctrl.name}}ControlVO = [{{#each ctrl.psSysCalendarItems as | calendarItem |}}{{#if calendarItem.psAppDataEntity}}{{pascalCase calendarItem.itemType}}ControlVO{{#unless @last}}, {{/unless}}{{/if}}{{/each}}]